<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>

<title></title>

<link rel="stylesheet" type="text/css" href="css/carstyle.css" media="all">
</head>
<body>
<div class="colorarea01">
	<div class="search clearfix">
		<div class="searchL">
			<ul class="menulist">
				<li><a href="addcar" class="list">返回车源列表</a></li>
			</ul>
		</div>
	</div>
	<form name="form1" class="carform" enctype="multipart/form-data" method="post" action="{{url('admin/addcar')}}" onsubmit="return chksubmit();">
	{!!csrf_field()!!}
		<table class="maintable" cellpadding="0" cellspacing="0"  id="tb" width="100%">
			<tbody><tr>
				<th>推荐位：</th>
				<td><input name="isrecom" value="1" type="checkbox"> 推荐 &nbsp;&nbsp;<input name="isshow" value="1" type="checkbox"> 特荐 &nbsp;&nbsp; <input name="ishot" value="1" type="checkbox"> 热门 </td>
				<th>浏览次数：</th>
				<td><input name="p_hits" value="" size="6" type="text"></td>
			</tr>
                            <tr>
				<th>品牌型号：</th>
				<td colspan="3">
				<em>
					<select name="p_brand" id="brand" datatype="n" nullmsg="请选择品牌！">
						<option value="">请选择品牌</option>
						@foreach ($cars as $u)
						<option value="{{$u->b_id}}" onclick="xi()">
						<span>{{$u->mark}}</span>
						{{$u->b_name}}</option>
						@endforeach	
					</select>
					</em>&nbsp;&nbsp;
					<span id="span"></span>
					<script>
				function xi(){
                var b_id = $('select[name=p_brand] option:selected').val();
                $.ajax({
                url:"{{'getAttributeByType'}}",
                data:{'b_id':b_id},
                dataType:'json',
                type:'get',
                success:function(msg){
                     var s = "";
                        s += "<select name ='p_subbrand' id='subbrand'>";
                        s += "<option value='0'>--请选择--</option>";
                        $.each(msg,function(kk,vv){
                           s+="<option value='"+vv.b_id+"' onclick='son()'>"+vv.b_name+"</option>";
                        });
                        s += "</select>";
                    $('#subbrand').remove();
                    $('em').append(s);
                }
                
                });
            }
					</script>

				<script>
					function son(){
					var b_id = $('select[name=p_subbrand] option:selected').val();
						$.ajax({
						url:"{{'songetAttributeByType'}}",
						data:{'b_id':b_id},
						dataType:'json',
						type:'get',
					success:function(msg){
					var s = "";
						s += "<select name ='p_subsubbrand' id='subsubbrand'>";
						s += "<option value='0'>--请选择--</option>";
						$.each(msg,function(kk,vv){
						s+="<option value='"+vv.b_id+"' >"+vv.b_name+"</option>";
						});
						s += "</select>";
						$('#subsubbrand').remove();
						$('#span').append(s);
						}
						});
						}
				</script>

					<select class="subbrand" id="subbrand" name="p_subbrand" datatype="n" nullmsg="请选择车系！">
						<option value="">请选择车系</option>
						                    
					</select>&nbsp;&nbsp;<select class="subbrand" id="subsubbrand" name="p_subsubbrand" datatype="n" nullmsg="请选择款式！">
					<option value="">请选择款式</option>
							
					</select>

					<input name="p_name" value="" size="10" type="text"><span class="Validform_checktip"></span></td>

			</tr>
			<tr>
				<th>车型选择：</th>
				<td><select name="p_model">
					<option value="0">请选择</option>
					@foreach ($model as $u)
					<option value="{{$u->sid}}">{{$u->s_name}}</option>
					@endforeach
					</select></td>
				<th>预售价格：</th>
				<td><input name="p_price" size="5" value="" datatype="s" nullmsg="请填写价格！" type="text">
					<span class="gray">(万元)</span><span class="Validform_checktip"></span></td>
			</tr>
			<tr>
				<th>车体颜色：</th>
				<td width="180"><select name="p_color">
						<option value="">请选择颜色</option>
<option value="白色">白色</option>
<option value="绿色">绿色</option>
<option value="蓝色">蓝色</option>
<option value="红色">红色</option>
<option value="黄色">黄色</option>
<option value="银灰">银灰</option>
<option value="黑色">黑色</option>
<option value="橙色">橙色</option>

					</select></td>
				<th width="50">排量：</th>
				<td><select name="p_gas">
						<option value="">请选择排量</option>
<option value="1.0">1.0</option>
<option value="1.2">1.2</option>
<option value="1.4">1.4</option>
<option value="1.5">1.5</option>
<option value="1.6">1.6</option>
<option value="1.8">1.8</option>
<option value="2.0">2.0</option>
<option value="2.4">2.4</option>
<option value="2.7">2.7</option>
<option value="3.0">3.0</option>
<option value="3.0以上">3.0以上</option>

					</select></td>
			</tr>
			<tr>
				<th>变速箱：</th>
				<td><select name="p_transmission">
						<option value="">请选择变速箱</option>
<option value="手动">手动</option>
<option value="自动">自动</option>
<option value="手自一体">手自一体</option>

					</select></td>
				<th>上牌日期：</th>
				<td><select name="p_year" id="p_year">
						<option value="">请选择年份</option>
<option value="2002">2002年</option>
<option value="2003">2003年</option>
<option value="2004">2004年</option>
<option value="2005">2005年</option>
<option value="2006">2006年</option>
<option value="2007">2007年</option>
<option value="2008">2008年</option>
<option value="2009">2009年</option>
<option value="2010">2010年</option>
<option value="2011">2011年</option>
<option value="2012">2012年</option>
<option value="2013">2013年</option>
<option value="2014">2014年</option>
<option value="2015">2015年</option>

					</select>
					<select name="p_month" id="p_month">
						<option value="">请选择月份</option>
<option value="01">01月</option>
<option value="02">02月</option>
<option value="03">03月</option>
<option value="04">04月</option>
<option value="05">05月</option>
<option value="06">06月</option>
<option value="07">07月</option>
<option value="08">08月</option>
<option value="09">09月</option>
<option value="10">10月</option>
<option value="11">11月</option>
<option value="12">12月</option>

					</select></td>
			</tr>
			<tr>
				<th>行驶里程：</th>
				<td><input name="p_kilometre" id="p_kilometre" size="5" value="" type="text">
					<span class="gray">(万公里)</span>
				</td>
				<th>国产进口：</th>
				<td><select name="p_country">
						<option value="">请选择</option>
<option value="国产">国产</option>
<option value="进口">进口</option>

					</select>
				</td>
			</tr>
			<tr>
				<th>排放标准：</th>
				<td colspan="3">
					<select name="p_emission">
						<option value="">请选择</option>
						<option value="国一">国一</option>
						<option value="国二">国二</option>
						<option value="国三">国三</option>
						<option value="国四">国四</option>
						<option value="国五">国五</option>
					</select>
				</td>
			</tr>
                      <tr>
				<th>交强险到期时间：</th>
				<td>
					
					<input name="para0" size="20" class="laydate-icon" value="" onclick="laydate()" type="text">
								</td>
            </tr>
                      <tr>
				<th>年检有效期至：</th>
				<td>
					
					<input name="para1" size="20" class="laydate-icon" value="" onclick="laydate()" type="text">
								</td>
            </tr>
                      <tr>
				<th>4S店定期保养：</th>
				<td>
					
					<select name="para2"><option value="">请选择</option>
<option value="是">是</option>
<option value="否">否</option>
</select>
								</td>
            </tr>
                      <tr>
				<th>车辆用途：</th>
				<td>
					
					<select name="para3"><option value="">请选择</option>
<option value="非营运">非营运</option>
<option value="营运">营运</option>
<option value="营转非">营转非</option>
<option value="租赁">租赁</option>
</select>
								</td>
            </tr>
                      <tr>
				<th>看车地区：</th>
				<td>
					
					<select name="para4"><option value="">请选择</option>
<option value="长安镇">长安镇</option>
<option value="虎门镇">虎门镇</option>
<option value="厚街镇">厚街镇</option>
<option value="南城区">南城区</option>
<option value="莞城区">莞城区</option>
<option value="东城区">东城区</option>
<option value="万江区">万江区</option>
<option value="沙田镇">沙田镇</option>
<option value="道滘镇">道滘镇</option>
<option value="寮步镇">寮步镇</option>
<option value="大朗镇">大朗镇</option>
<option value="常平镇">常平镇</option>
<option value="黄江镇">黄江镇</option>
<option value="高埗镇">高埗镇</option>
<option value="茶山镇">茶山镇</option>
<option value="石龙镇">石龙镇</option>
<option value="石排镇">石排镇</option>
<option value="石碣镇">石碣镇</option>
<option value="桥头镇">桥头镇</option>
<option value="大岭山">大岭山</option>
<option value="望牛墩">望牛墩</option>
<option value="洪梅镇">洪梅镇</option>
<option value="中堂镇">中堂镇</option>
<option value="麻涌镇">麻涌镇</option>
</select>
								</td>
            </tr>
           			<tr>
				<th>图片：</th>
				<td colspan="3">
					<ul id="piclist" class="clearfix">
					</ul>

				<input type="file"  name="p_pics" value="上传" />
			<!-- 		<input id="J_selectImage" onclick="$this->type = "  value="批量上传图片" class="uploadbut" type="button" > -->
					<div id="mainpic">
						
					</div>
				</td>
			</tr>
			<tr>
				<th>车辆补充描述：</th>
				<td colspan="5"><textarea name="p_details" rows="2" cols="90" class="textarea01"></textarea></td>
			</tr>
			<tr>
				<th>车主姓名：</th>
				<td colspan="5"><input name="p_username" value="" type="text"></td>
			</tr>
			<tr>
				<th>联系电话：</th>
				<td colspan="5"><input name="p_tel" value="" type="text"></td>
			</tr>
			<tr>
				<th></th>
				<td colspan="5"><div class="buttons">
						<input value="添加车源" class="submit" type="submit">
						<input name="a" value="add" type="hidden">
						<input name="id" value="" type="hidden">
						<input name="page" value="1" type="hidden">
				</div>
				</td>
			</tr>
		</tbody></table>
	</form>
</div>

</body>
</html>
